<template>
  <div>
    <input v-foc type="text" />
    <input v-focus type="text">
  </div>
</template>

<script>
export default {
  name: "VueComponentsApp",

  data() {
    return {};
  },
  // 局部注册指令
  directives: {
    focus: {
      inserted(el) {
        el.focus();
      },
    },
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="scss" scoped>
</style>